package pe.gob.mimp.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import pe.gob.mimp.model.Usuario;
import pe.gob.mimp.service.UsuarioService;
import pe.gob.mimp.util.Encriptacion;

@Controller
@RequestMapping(value = "/logout")
public class LogoutController {
	@Autowired
	private UsuarioService usuarioService;

	@RequestMapping(method = RequestMethod.GET)
	public String showCasoForm(Model model,HttpServletRequest request) {
		Usuario usuario = new Usuario();
		HttpSession session = request.getSession();
		
		session.setAttribute("login",null);
		model.addAttribute("login", usuario);
		return "redirect:login";
	}

}
